package com.thb.pay.api.agent;


import com.thb.pay.api.agent.fallback.AgentChannelServiceApiFallbackFactory;
import com.thb.pay.api.agent.vo.req.AgentChannelReq;
import com.thb.pay.api.agent.vo.resp.AgentChannelVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>
 * 代理商-通道表 前端控制器
 * </p>
 *
 * @author lucky
 * @since 2019-07-21
 */
@FeignClient(value = "pay-service", fallbackFactory = AgentChannelServiceApiFallbackFactory.class)
@RequestMapping("/agentChannelApi")
public interface AgentChannelServiceApi {

    /**
     * @param agentId
     * @return
     * @方法名称
     * @功能描述 获取代理商所有的配置通道信息
     * @作者: lucky
     * @创建时间: 2019/10/14
     **/
    @RequestMapping(value = "/findListByAgentId", method = RequestMethod.GET)
    List<AgentChannelVo> findListByAgentId(@RequestParam("agentId") Long agentId);

    /**
     * @param agentId
     * @param productId
     * @Description 获取代理通道详情
     * @Author lucky
     * @data 2019/10/14 22:09
     */
    @RequestMapping(value = "/getByAgentIdAndProductId", method = RequestMethod.GET)
    AgentChannelVo getByAgentIdAndProductId(@RequestParam("agentId") Long agentId, @RequestParam("productId") Long productId);

    /**
     * @param agentChannelReq
     * @Description 添加或修改代理商通道
     * @Author lucky
     * @data 2019/10/14 23:24
     */
    @RequestMapping(value = "/addOrUpdate", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void addOrUpdate(@RequestBody AgentChannelReq agentChannelReq);
}
